<%@ Page Language="VB" MasterPageFile="~/ZayedHouse.master" AutoEventWireup="false"
    CodeFile="RFQ.aspx.vb" Inherits="Processes_Purchasing_LPO" Title="Untitled Page" %>

<%@ Register Src="../../../UserControl/DDL.ascx" TagName="DDL" TagPrefix="uc1" %>
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPH1" runat="Server">

    <script type="text/javascript">
    function openUploadDialog(Scr_Code) 
    {
   win =window.open("../../../UserControl/UploadFilesDialog.aspx?UploadHdrId=" + document.getElementById('ctl00$CPH1$hdnUploadHdrId').value + "&StepParam=" + document.getElementById('ctl00_CPH1_hdnStepParam').value + "&Scr_Code=" + Scr_Code, '_Parent', "height=500,width=900");
//   win =window.showModalDialog( "../../../UserControl/UploadFilesDialog.aspx?UploadHdrId=" + document.getElementById('ctl00$CPH1$hdnUploadHdrId').value + "&StepParam=" + document.getElementById('ctl00_CPH1_hdnStepParam').value + "&Scr_Code=" + Scr_Code,window,"dialogHeight:600px;dialogWidth:800px;center:yes;scroll:yes;resizable:no)");
//   __doPostBack('ctl00$CPH1$hdnUploadHdrId','');
  
    }
    </script>

    <table style="width: 100%; table-layout: fixed">
        <tr>
            <td>
                <asp:Label ID="lblDate" runat="server" meta:resourceKey="lblDate"></asp:Label></td>
            <td style="width: 200px">
                <telerik:RadDateInput ID="rdiDate" runat="server" Enabled="False" ReadOnly="True"
                    SkinID="EnterDate" TabIndex="-1">
                </telerik:RadDateInput></td>
            <td>
                <asp:Label ID="lblID" runat="server" meta:resourceKey="lblID" Visible="False"></asp:Label>
            </td>
            <td>
                <telerik:RadTextBox ID="rtxtID" runat="server" SkinID="Text" Enabled="False" Visible="False">
                </telerik:RadTextBox></td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblPurchaseOrderNo" runat="server" meta:resourceKey="lblPurchaseOrderNo"></asp:Label></td>
            <td>
                <telerik:RadTextBox ID="rtxtPurchaseOrderNo" runat="server" SkinID="Text" Enabled="False">
                </telerik:RadTextBox></td>
            <td>
                <asp:Label ID="lblPurchaseOrderYear" runat="server" meta:resourceKey="lblPurchaseOrderYear"></asp:Label></td>
            <td>
                  <telerik:RadDateInput ID="rdiPurchaseOrderYear" runat="server" ReadOnly="True" SkinID="EnterDate"
                    Enabled="False" TabIndex="-1">
                </telerik:RadDateInput>
                
                </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblPurchaseType" runat="server" meta:resourceKey="lblPurchaseType"></asp:Label></td>
            <td colspan="2">
                <asp:RadioButtonList ID="rblPurchaseType" runat="server" RepeatDirection="Horizontal"
                    AutoPostBack="True">
                    <asp:ListItem Selected="True" Text="<%$ Resources:SystemResource ,Tender %>"></asp:ListItem>
                    <asp:ListItem Text="<%$ Resources:SystemResource ,Pursue %>"></asp:ListItem>
                    <asp:ListItem Text="<%$ Resources:SystemResource ,DirectOrder %>"></asp:ListItem>
                    
                </asp:RadioButtonList></td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblTenderNo" runat="server" meta:resourceKey="lblTenderNo"></asp:Label></td>
            <td>
                <telerik:RadTextBox ID="rtxtTenderNo" runat="server" SkinID="Text">
                </telerik:RadTextBox></td>
            <td>
                <asp:Label ID="lblTenderDate" runat="server" meta:resourceKey="lblTenderDate"></asp:Label></td>
            <td>
                <telerik:RadDatePicker ID="rdpTenderDate" runat="server" Skin="WebBlue" SkinID="Date">
                    <DateInput LabelCssClass="radLabelCss_WebBlue" Skin="WebBlue">
                    </DateInput>
                    <Calendar Skin="WebBlue">
                    </Calendar>
                    <DatePopupButton CssClass="radPopupImage_WebBlue" />
                </telerik:RadDatePicker>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblTenderReceiveDate" runat="server" meta:resourceKey="lblTenderReceiveDate"></asp:Label></td>
            <td>
                <telerik:RadDatePicker ID="rdpTenderReceiveDate" runat="server" Skin="WebBlue" SkinID="Date">
                    <DateInput LabelCssClass="radLabelCss_WebBlue" Skin="WebBlue">
                    </DateInput>
                    <Calendar Skin="WebBlue">
                    </Calendar>
                    <DatePopupButton CssClass="radPopupImage_WebBlue" />
                </telerik:RadDatePicker>
                <asp:RequiredFieldValidator ID="rfvDateOfSupply" runat="server" ControlToValidate="rdpTenderReceiveDate"
                    ErrorMessage="<%$ Resources:Controls, RequiredValidationText %>" ValidationGroup="Submit"></asp:RequiredFieldValidator>
            </td>
            <td>
                <asp:Label ID="lblTenderReceiveTime" runat="server" meta:resourceKey="lblTenderReceiveTime"></asp:Label></td>
            <td>
                <telerik:RadTimePicker ID="rtpTenderReceiveTime" runat="server" Skin="WebBlue" SkinID="Time">
                    <TimePopupButton CssClass="" />
                    <TimeView Skin="WebBlue">
                    </TimeView>
                    <DateInput LabelCssClass="" Skin="WebBlue" Width="">
                    </DateInput>
                    <Calendar Skin="WebBlue" UseColumnHeadersAsSelectors="True" UseRowHeadersAsSelectors="True">
                    </Calendar>
                    <DatePopupButton CssClass="" Visible="False" />
                </telerik:RadTimePicker>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="rtpTenderReceiveTime"
                    ErrorMessage="<%$ Resources:Controls, RequiredValidationText %>" ValidationGroup="Submit"></asp:RequiredFieldValidator>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblResponsiblePerson" runat="server" meta:resourceKey="lblResponsiblePerson"></asp:Label></td>
            <td colspan="2">
                <uc1:DDL ID="fddlResponsiblePerson" DefaultChoosedItem="ChooseOne" runat="server"
                    DataSourceId="odsAllEmployees" DataTextField="a_Name" DataValueField="app_no"
                    IsRequired="false" />
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
                <asp:Label ID="lblDescription" runat="server" meta:resourceKey="lblDescription"></asp:Label></td>
            <td colspan="3">
                <telerik:RadTextBox ID="rtxtConditions" runat="server" SkinID="Text" TabIndex="-1"
                    Width="500px">
                </telerik:RadTextBox></td>
            <td>
            </td>
        </tr>
        <tr>
            <td style="height: 9px">
                <asp:Label ID="lblMaterials" runat="server" meta:resourceKey="lblMaterials"></asp:Label></td>
            <td colspan="3" style="height: 9px">
            </td>
            <td style="height: 9px">
            </td>
        </tr>
        <tr>
            <td colspan="5">
                <telerik:RadGrid ID="rgMat" runat="server" GridLines="None" DataSourceID="SDSMaterials"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" Width="97%" AllowAutomaticUpdates="True"
                    AutoGenerateColumns="False" Skin="WebBlue" MasterTableView-Dir="<%$ Resources:SystemResource, HTMLDirectionality %>"
                    GroupPanel-Text="<%$ Resources:Grid ,GroupPanelText %>">
                    <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="IDNO"
                        TableLayout="Fixed" DataSourceID="SDSMaterials" HorizontalAlign="NotSet" NoMasterRecordsText="<%$ Resources:Grid , NoMasterRecordsText %>">
                        <CommandItemTemplate>
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/AddRecord.gif" />&nbsp;&nbsp;<asp:LinkButton
                                ID="LinkButton2" runat="server" Font-Size="Large" Text="<%$ Resources:Grid , AddNew %>"
                                CommandName="InitInsert" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/Edit.gif" />&nbsp;&nbsp;
                            <asp:LinkButton ID="btnEditSelected" runat="server" Font-Size="Large" Text="<%$ Resources:Grid , EditSelected %>"
                                CommandName="EditSelected" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/Delete.gif" />&nbsp;&nbsp;<asp:LinkButton
                                ID="LinkButton1" Font-Size="Large" OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>"
                                runat="server" Text="<%$ Resources:Grid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/Refresh.gif" />&nbsp;&nbsp;<asp:LinkButton
                                ID="LinkButton4" Font-Size="Large" runat="server" Text="<%$ Resources:Grid , Refresh %>"
                                CommandName="RebindGrid" />
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                <ItemStyle CssClass="MyImageButton" />
                                <HeaderStyle Width="50px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="ItemNo" HeaderText="<%$ Resources:MainGrid , ItemNo %>"
                                SortExpression="ItemNo" UniqueName="ItemNo">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="ItemNo" DataSourceID="ODSItem" HeaderText="<%$ Resources:MainGrid , Item %>"
                                ListTextField="ItemName" ListValueField="ItemNo" UniqueName="ItemNo" EnableEmptyListItem="True">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn DataField="ItemDesc" HeaderText="<%$ Resources:MainGrid , ItemDesc %>"
                                SortExpression="ItemDesc" UniqueName="ItemDesc">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="UnitNo" HeaderText="<%$ Resources:MainGrid , UnitNo %>"
                                SortExpression="UnitNo" UniqueName="UnitNo" Visible="False">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="UnitNo" DataSourceID="ODSAllUnits" HeaderText="<%$ Resources:MainGrid , Unit %>"
                                ListTextField="UnitDesc" ListValueField="UnitNo" UniqueName="UnitNo" EnableEmptyListItem="True">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn HeaderText="<%$ Resources:MainGrid , GoodsOrigin %>" DataField="ItemOrigin"
                                UniqueName="ItemOrigin">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="<%$ Resources:MainGrid , SupplyPeriod %>" DataField="IncomingPeriod"
                                UniqueName="IncomingPeriod">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridNumericColumn DataField="Qty" HeaderText="<%$ Resources:MainGrid , Qty %>"
                                DataFormatString="{0:###,###}" SortExpression="Qty" UniqueName="Qty" EditFormColumnIndex="1"
                                NumericType="Number">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridNumericColumn>
                            <telerik:GridButtonColumn ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"
                                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                <HeaderStyle Width="20px" />
                                <ItemStyle Width="50px" HorizontalAlign="Center" CssClass="MyImageButton" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
                                    style="border-collapse: collapse; background: white;">
                                    <tr class="EditFormHeader">
                                        <td colspan="2" style="font-size: small">
                                            <b>
                                                <asp:Label ID="Label1" meta:resourceKey="lblMaterials" runat="server"></asp:Label>
                                            </b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="1">
                                            <b>
                                                <asp:Label ID="lblSpecification" meta:resourceKey="lblSpecification" runat="server"></asp:Label></b></td>
                                        <td colspan="1">
                                            <b>
                                                <asp:Label ID="lblAmounts" meta:resourceKey="Amounts" runat="server"></asp:Label></b></td>
                                    </tr>
                                    <tr>
                                        <td colspan="1" style="width: 500px">
                                            <table id="Table3" cellspacing="1" cellpadding="1" width="500" border="0" class="module">
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblEdtItemNo" Text="<%$ Resources:MainGrid, ItemNo %>" runat="server"></asp:Label></td>
                                                    <td>
                                                        <uc1:DDL ID="WUCItem" runat="server" DataSourceId="ODSItem" DataTextField="ItemName"
                                                            DataValueField="ItemNo" SelectedValue='<%# Bind( "ItemNo") %>' DefaultChoosedItem="ChooseOne"
                                                            IsRequired="true" ValidationGroup="AddRow" AutoPostBack="true" OnSelectedIndexChanged="FillAvailableAmount" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblEdtItemDesc" Text="<%$ Resources:MainGrid, ItemDesc %>" runat="server"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadTextBox ID="rtxtEdtItemDesc" runat="server" Text='<%# Bind( "ItemDesc") %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblEdtUnitNo" Text="<%$ Resources:MainGrid, UnitNo %>" runat="server"></asp:Label></td>
                                                    <td>
                                                        <uc1:DDL ID="WUCUnit" IsRequired="true" runat="server" DataTextField="UnitDesc" DataValueField="UnitNo"
                                                            SelectedValue='<%# Bind( "UnitNo") %>' DefaultChoosedItem="ChooseOne" ValidationGroup="AddRow"
                                                            DataSourceId="ODSUnit" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td style="width: 350px">
                                            <table id="Table4" cellspacing="1" cellpadding="1" width="350" border="0" class="module">
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblEdtItemOrigin" Text="<%$ Resources:MainGrid, GoodsOrigin %>" runat="server"></asp:Label></td>
                                                    <td>
                                                        <telerik:RadTextBox ID="rntxtGoodsOrigin" runat="server" MaxLength="10" Width="90px"
                                                            Text='<%# Bind( "ItemOrigin") %>'>
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblEdtSupplyPeriod" Text="<%$ Resources:MainGrid, SupplyPeriod %>"
                                                            runat="server"></asp:Label></td>
                                                    <td>
                                                        <telerik:RadTextBox ID="rtxtEdtSupplyPeriod" runat="server" Width="90px" Text='<%# Bind( "IncomingPeriod") %>'
                                                            Skin="WebBlue">
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblQty" Text="<%$ Resources:MainGrid, Qty %>" runat="server"></asp:Label></td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="rntxtEdtQty" runat="server" MaxLength="7" Width="90px"
                                                            ValidationGroup="AddRow" DbValue='<%# Bind( "Qty") %>'>
                                                            <NumberFormat DecimalDigits="0" GroupSeparator="," NegativePattern="-n" PositivePattern="n" />
                                                        </telerik:RadNumericTextBox>
                                                        <asp:RequiredFieldValidator ID="rfvrntxtEdtQty" runat="server" ControlToValidate="rntxtEdtQty"
                                                            ErrorMessage="<%$ Resources:Controls, RequiredValidationText %>" ValidationGroup="AddRow"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <asp:ImageButton ID="imgbtnEdtInsert" runat="server" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>'
                                                CommandName="PerformInsert" ImageUrl="<%$ Resources:Controls, btnAddRow %>" ToolTip="AddRow"
                                                ValidationGroup="AddRow" />
                                            <asp:ImageButton ID="imgbtnEdtUpdate" runat="server" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "False", "True") %>'
                                                CommandName="Update" ImageUrl="<%$ Resources:Controls, btnUpdate %>" ToolTip="Update"
                                                ValidationGroup="AddRow" />
                                            <asp:ImageButton ID="imgbtnEdtCancel" runat="server" CommandName="Cancel" ImageUrl="<%$ Resources:Controls, btnBack %>"
                                                CausesValidation="False" ToolTip="Back" />
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                            Font-Underline="False" HorizontalAlign="Center" Wrap="True" />
                    </MasterTableView>
                    <FilterMenu EnableTheming="True" Skin="WebBlue">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                    <ClientSettings AllowDragToGroup="True">
                        <Scrolling AllowScroll="True" ScrollHeight="400px" />
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                </telerik:RadGrid>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblSuppliers" runat="server" meta:resourceKey="lblSuppliers"></asp:Label></td>
            <td colspan="4">
            </td>
        </tr>
        <tr>
            <td colspan="5">
                <telerik:RadGrid ID="rgSupp" runat="server" GridLines="None" DataSourceID="SDSSuppliers"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" Width="97%" AllowAutomaticUpdates="True"
                    AutoGenerateColumns="False" Skin="WebBlue" MasterTableView-Dir="<%$ Resources:SystemResource, HTMLDirectionality %>"
                    GroupPanel-Text="<%$ Resources:Grid ,GroupPanelText %>">
                    <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="SAccNo"
                        TableLayout="Fixed" DataSourceID="SDSSuppliers" HorizontalAlign="NotSet" NoMasterRecordsText="<%$ Resources:Grid , NoMasterRecordsText %>">
                        <CommandItemTemplate>
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/AddRecord.gif" />&nbsp;&nbsp;<asp:LinkButton
                                ID="LinkButton2" runat="server" Font-Size="Large" Text="<%$ Resources:Grid , AddNew %>"
                                CommandName="InitInsert" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/Edit.gif" />&nbsp;&nbsp;
                            <asp:LinkButton ID="btnEditSelected" runat="server" Font-Size="Large" Text="<%$ Resources:Grid , EditSelected %>"
                                CommandName="EditSelected" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/Delete.gif" />&nbsp;&nbsp;<asp:LinkButton
                                ID="LinkButton1" Font-Size="Large" OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>"
                                runat="server" Text="<%$ Resources:Grid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <img style="border: 0px; vertical-align: middle;" alt="" src="../../../images/Grid/Refresh.gif" />&nbsp;&nbsp;<asp:LinkButton
                                ID="LinkButton4" Font-Size="Large" runat="server" Text="<%$ Resources:Grid , Refresh %>"
                                CommandName="RebindGrid" />
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                <ItemStyle CssClass="MyImageButton" />
                                <HeaderStyle Width="50px" />
                            </telerik:GridEditCommandColumn>
                              <telerik:GridBoundColumn DataField="IDNO" HeaderText="IDNO" ReadOnly="True"
                                SortExpression="IDNO" UniqueName="IDNO" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TransYear" HeaderText="TransYear" ReadOnly="True"
                                SortExpression="TransYear" UniqueName="TransYear" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="RequestNo" HeaderText="RequestNo" ReadOnly="True"
                                SortExpression="RequestNo" UniqueName="RequestNo" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="SAccNo" HeaderText="<%$ Resources:MainGrid , SupplierNo %>"
                                SortExpression="SAccNo" UniqueName="SAccNo">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="SAccNo" DataSourceID="ODSSupplier" HeaderText="<%$ Resources:MainGrid , SupplierName %>"
                                ListTextField="SupplierName" ListValueField="SAccNo" UniqueName="SAccNo" EnableEmptyListItem="True">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridDropDownColumn>
                            <telerik:GridButtonColumn ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"
                                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                <HeaderStyle Width="20px" />
                                <ItemStyle Width="50px" HorizontalAlign="Center" CssClass="MyImageButton" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
                                    style="border-collapse: collapse; background: white;">
                                    <tr class="EditFormHeader">
                                        <td colspan="2" style="font-size: small">
                                            <b>
                                                <asp:Label ID="Label1" meta:resourceKey="lblSuppliers" runat="server"></asp:Label>
                                            </b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="1">
                                            <b>
                                                <asp:Label ID="lblSpecification" meta:resourceKey="lblSpecification" runat="server"></asp:Label></b></td>
                                        <td colspan="1">
                                            <b>
                                                <asp:Label ID="lblAmounts" meta:resourceKey="Amounts" runat="server"></asp:Label></b></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="width: 500px">
                                            <table id="Table3" cellspacing="1" cellpadding="1" width="500" border="0" class="module">
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblEdtSAccNo" Text="<%$ Resources:MainGrid, SupplierNo %>" runat="server"></asp:Label></td>
                                                    <td>
                                                        <uc1:DDL ID="WUCSupplier" runat="server" DataSourceId="ODSSupplier" DataTextField="SupplierName"
                                                            DataValueField="SAccNo" SelectedValue='<%# Bind( "SAccNo") %>' DefaultChoosedItem="ChooseOne"
                                                            IsRequired="true" ValidationGroup="AddRow" AutoPostBack="False" OnSelectedIndexChanged="FillAvailableAmount" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                
                                <tr>
                                    <td colspan="2">
                                        <asp:ImageButton ID="imgbtnEdtInsert" runat="server" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>'
                                            CommandName="PerformInsert" ImageUrl="<%$ Resources:Controls, btnAddRow %>" ToolTip="AddRow"
                                            ValidationGroup="AddRow" />
                                        <asp:ImageButton ID="imgbtnEdtUpdate" runat="server" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "False", "True") %>'
                                            CommandName="Update" ImageUrl="<%$ Resources:Controls, btnUpdate %>" ToolTip="Update"
                                            ValidationGroup="AddRow" />
                                        <asp:ImageButton ID="imgbtnEdtCancel" runat="server" CommandName="Cancel" ImageUrl="<%$ Resources:Controls, btnBack %>"
                                            CausesValidation="False" ToolTip="Back" />
                                    </td>
                                </tr>
                                </table>
                            </FormTemplate>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
 
   
  
                        </EditFormSettings>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                            Font-Underline="False" HorizontalAlign="Center" Wrap="True" />
 
 
                    </MasterTableView>
                    <FilterMenu EnableTheming="True" Skin="WebBlue">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                    <ClientSettings AllowDragToGroup="True">
                        <Scrolling AllowScroll="True" ScrollHeight="200px" />
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>


                </telerik:RadGrid>
            </td>
        </tr>



        <tr>
            <td>
                <asp:Label ID="lblConditions" runat="server" meta:resourceKey="lblConditions"></asp:Label></td>
            <td colspan="4">

            </td>
        </tr>
               <tr>
           
            <td colspan="5">
                <telerik:RadEditor ID="reConditions" runat="server" Skin="WebBlue">
                    <Content>
                    </Content>
                </telerik:RadEditor>
            </td>
        </tr>
        
        <tr>
            <td>
                <asp:Label ID="lblUpload" runat="server" Font-Bold="False" meta:resourcekey="lblUpload"></asp:Label></td>
            <td colspan="4">
                <asp:ImageButton ID="btnUpload" runat="server" CausesValidation="False" ImageUrl="<%$ Resources:controls, btnUpload %>"
                    OnClientClick="openUploadDialog('RFQ');return false;" /></td>
        </tr>
        <tr>
            <td colspan="5" align="center">
                <asp:ImageButton ID="btnBack" runat="server" ImageUrl="<%$ Resources:Controls, btnBack %>"
                    ToolTip="Back" Visible="False" /><asp:ImageButton ID="btnPrint" runat="server" ImageUrl="<%$ Resources:Controls, btnPrint %>"
                        ToolTip="Print" Visible="False" /><asp:ImageButton ID="btnSend" runat="server" ImageUrl="<%$ Resources:controls, btnSend %>"
                            ToolTip="Send" ValidationGroup="Submit" /></td>
        </tr>
    </table>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rblPurchaseType">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rblPurchaseType" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lblTenderNo" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lblTenderDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgMat">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgMat" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgSupp">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgSupp" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:ObjectDataSource ID="odsAllEmployees" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="QueryDatabase" TypeName="CL_ORM.DBProcess_EmployeesSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvAllEmployees" Name="Operation" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="User_ID" Type="String" />
            <asp:Parameter Name="DepNo" Type="String" />
            <asp:Parameter Name="MangNo" Type="String" />
            <asp:Parameter Name="SecNo" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
  
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="True">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
            style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>

    <sds:SessionDataSource ID="SDSMaterials" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStrAccounting %>"
        SelectCommand="EXEC	[WFRequestPriceDtl1] 'RtvRequestPriceDtl1',@IDNO ,@RequestNo ,@TransYear"
        DeleteCommand="DELETE FROM [RequestPriceDtl1] WHERE [IDNO] = ?" InsertCommand="INSERT INTO RequestPriceDtl1(RequestNo, TransYear, ItemNo, ItemDesc, ItemOrigin, UnitNo, Qty, IncomingPeriod) VALUES ( @RequestNo,@TransYear,?, ?, ?, ?, ?, ?)"
        UpdateCommand="UPDATE [RequestPriceDtl1] SET [TransYear] = @TransYear, [RequestNo] = @RequestNo, [ItemNo] = ?,[ItemDesc] = ?,[ItemOrigin] = ?, [UnitNo] = ?, [Qty] = ?, [IncomingPeriod] = ? WHERE [TransYear] =  @TransYear And [RequestNo] = @RequestNo And [IDNO] = ?  And [ItemNo] = ? And [ItemDesc] = ?  And [UnitNo] = ? And [Qty] = ? And [ItemOrigin] = ? And [IncomingPeriod] = ?"
        PrimaryKeyFields="IDNO" OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues"
        ClearSessionOnInitialLoad="True" SessionKey="System.Web.UI.Page_SessionDataSource1">
        <SelectParameters>
            <asp:ControlParameter ControlID="hdnYear" Name="TransYear" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnPurchaseOrderNo" Name="RequestNo" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnID" Name="IDNO" PropertyName="Value" Type="String" />
            
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="hdnYear" Name="TransYear" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnID" Name="RequestNo" PropertyName="Value"
                Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="hdnYear" Name="TransYear" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnID" Name="RequestNo" PropertyName="Value"
                Type="String" />
        </InsertParameters>
    </sds:SessionDataSource>
    <sds:SessionDataSource ID="SDSSuppliers" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStrAccounting %>"
        SelectCommand="EXEC	[WFRequestPriceDtl2] 'RetrieveRequestPriceDtl2',NULL,@RequestNo, @TransYear"
        DeleteCommand="DELETE FROM [RequestPriceDtl2] WHERE [IDNO] = ?" InsertCommand="INSERT INTO RequestPriceDtl2(RequestNo, TransYear, SAccNo) VALUES ( @RequestNo,@TransYear,?)"
        UpdateCommand="UPDATE [RequestPriceDtl2] SET [TransYear] = @TransYear, [RequestNo] = @RequestNo, [SAccNo] = ? WHERE [TransYear] =  @TransYear And [RequestNo] = @RequestNo And [SAccNo] = ?  And [IDNO] = ?  "
        PrimaryKeyFields="IDNO" OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues"
        ClearSessionOnInitialLoad="True" SessionKey="System.Web.UI.Page_SessionDataSource2">
        <SelectParameters>
            <asp:ControlParameter ControlID="hdnYear" Name="TransYear" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnID" Name="RequestNo" PropertyName="Value"
                Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="hdnYear" Name="TransYear" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnID" Name="RequestNo" PropertyName="Value"
                Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="hdnYear" Name="TransYear" PropertyName="Value" Type="String" />
            <asp:ControlParameter ControlID="hdnID" Name="RequestNo" PropertyName="Value"
                Type="String" />
        </InsertParameters>
    </sds:SessionDataSource>
    <asp:ObjectDataSource ID="ODSUnit" runat="server" SelectMethod="QueryDatabase" TypeName="CL_ORM.DBWFRetrieveSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RetrieveUnit" Name="Operation" Type="String" />
            <asp:Parameter Name="CostCenterNo" Type="String" />
            <asp:Parameter Name="ProgramNO" Type="String" />
            <asp:Parameter Name="ProjectNO" Type="String" />
            <asp:Parameter Name="lEVEL" Type="String" />
            <asp:ControlParameter ControlID="hdnItemNo" Name="ItemNo" PropertyName="Value" Type="String" />
            <asp:Parameter Name="FParmeter" Type="String" />
            <asp:Parameter Name="SParmeter" Type="String" />
            <asp:Parameter Name="TParmeter" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ODSAllUnits" runat="server" SelectMethod="QueryDatabase"
        TypeName="CL_ORM.DBWFRetrieveSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RetrieveAllUnits" Name="Operation" Type="String" />
            <asp:Parameter Name="CostCenterNo" Type="String" />
            <asp:Parameter Name="ProgramNO" Type="String" />
            <asp:Parameter Name="ProjectNO" Type="String" />
            <asp:Parameter Name="lEVEL" Type="String" />
            <asp:Parameter Name="ItemNo" Type="String" />
            <asp:Parameter Name="FParmeter" Type="String" />
            <asp:Parameter Name="SParmeter" Type="String" />
            <asp:Parameter Name="TParmeter" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ODSItem" runat="server" SelectMethod="QueryDatabase" TypeName="CL_ORM.DBWFRetrieveSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RetrieveItem" Name="Operation" Type="String" />
            <asp:Parameter Name="CostCenterNo" Type="String" />
            <asp:Parameter Name="ProgramNO" Type="String" />
            <asp:Parameter Name="ProjectNO" Type="String" />
            <asp:Parameter Name="lEVEL" Type="String" />
            <asp:Parameter Name="ItemNo" Type="String" />
            <asp:Parameter Name="FParmeter" Type="String" />
            <asp:Parameter Name="SParmeter" Type="String" />
            <asp:Parameter Name="TParmeter" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ODSSupplier" runat="server" SelectMethod="QueryDatabase"
        TypeName="CL_ORM.DBWFRetrieveSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RetrieveSupplier" Name="Operation" Type="String" />
            <asp:Parameter Name="CostCenterNo" Type="String" />
            <asp:Parameter Name="ProgramNO" Type="String" />
            <asp:Parameter Name="ProjectNO" Type="String" />
            <asp:Parameter Name="lEVEL" Type="String" />
            <asp:Parameter Name="ItemNo" Type="String" />
            <asp:Parameter Name="FParmeter" Type="String" />
            <asp:Parameter Name="SParmeter" Type="String" />
            <asp:Parameter Name="TParmeter" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
    
    <asp:HiddenField ID="hdnItemNo" runat="server" />
        <asp:HiddenField ID="hdnStepParam" runat="server" />
    <asp:HiddenField ID="hdnYear" runat="server" />
    <asp:HiddenField ID="hdnID" runat="server" />
     <asp:HiddenField ID="hdnUploadHdrId" runat="server" />    
    <asp:HiddenField ID="hdnPurchaseOrderNo" runat="server" />
    <asp:HiddenField ID="hdnPurchaseOrderYear" runat="server" />
    <asp:HiddenField ID="hdnEmp_DepNo" runat="server" />
    <asp:HiddenField ID="hdnUserName" runat="server" />

</asp:Content>
